<?php
include "inc-config.php";

$XML = simplexml_load_file($StatsFile);
$online = $XML->status->oplayers;
$oally = $XML->status->alliance;
$ohorde = $XML->status->horde;
$ogms = $XML->status->gmcount;
$aconns = $XML->status->acceptedconns;
$peakcount = $XML->status->peakcount;
$avglat = $XML->status->avglat;
$cpu = $XML->status->cpu;
$ram = $XML->status->ram;
$threads = $XML->status->threads;
$uptime = $XML->status->uptime;
$platform = $XML->status->platform;
$qplayers = $XML->status->qplayers;
$lastupdate = $XML->status->lastupdate;
?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="4" cellpadding="1" align="left" style="margin-bottom:0px; font-family:Arial, Helvetica, sans-serif; width: 322px; border:solid 1px #000000; background:#1a1a1a; border-bottom:solid 1px #333333; border-right:solid 1px #333333;border-left: solid 1px #555555; border-top: solid 1px #555555; color:#CCCCCC; margin-bottom: 6px">
				<tr>
					<th width="45%" style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/user.gif" /> Online Players: </th>
					<td width="55%"><span id="oplayers"/><?php echo $online; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/usera.gif" /> Alliance Online: </th>
					<td><span id="alliance"/><?php echo $oally; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/userh.gif" /> Horde Online: </th>
					<td><span id="horde"/><?php echo $ohorde; ?></span></td>
				</tr>
				<tr>
				<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/usergm.gif" /> Online GM's: </th>
				<td><span id="gmcount"/><?php echo $ogms; ?></span></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>	 
			<table width="100%" border="0" cellspacing="4" cellpadding="1" align="left" style="margin-bottom:0px; width: 322px; border:solid 1px #000000; background:#1a1a1a; border-bottom:solid 1px #333333; border-right:solid 1px #333333;font-family:Arial, Helvetica, sans-serif;border-left: solid 1px #555555; border-top: solid 1px #555555; color:#CCCCCC; margin-bottom: 6px">
				<tr>
					<th width="45%" style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/peak.gif" /> Connection Peak: </th>
					<td width="55%"><span id="peakcount"/><?php echo $peakcount; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/accept.gif" /> Accepted Conn.: </th>
					<td><span id="acceptedconns"/><?php echo $aconns; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/minus.gif" /> Queued Players: </th>
					<td><span id="qplayers"/><?php echo $qplayers; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/lat.gif" /> Average Latency: </th>
					<td><span id="avglat"/><?php echo $avglat; ?></span> ms</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="4" cellpadding="1" align="left" style="margin-bottom:0px; width: 322px; border:solid 1px #000000; background:#1a1a1a; border-bottom:solid 1px #333333; border-right:solid 1px #333333;font-family:Arial, Helvetica, sans-serif; border-left: solid 1px #555555; border-top: solid 1px #555555; color:#CCCCCC;">
				<tr>
					<th width="45%" style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/cpu.gif" /> CPU Usage: </th>
					<td width="55%"><span id="cpu"/><?php echo $cpu; ?></span>%</td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/mem.gif" /> Memory Usage:</th>
					<td><span id="ram"/><?php echo $ram; ?></span> MB</td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/cpu.gif" />  Thread Count: </th>
					<td><span id="threads"/><?php echo $threads; ?></span></td>
				</tr>
				<tr>
					<th style="	font-size:9pt;text-align: left;color:#FFFFFF;"><img src="images/icons/GIF/comp.gif" /> Last Update: </th>
					<td><span id="lastupdate"/><?php echo $lastupdate; ?></span></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
		<div style="float:left; width: 330px; color:#CCCCCC">
			<center>
				<span id="uptime"/></span>
				<div style=" padding-bottom: 9px"></div>
				<span id="platform"/><?php echo $platform; ?></span>
			</center>
		</div>
		</td>
	</tr>
</table>
